//=============================================================================
#include "CApp.h"

//=============================================================================
void CApp::OnRender_Main() {
    glutSetWindow(Win_Main);

    glClear(GL_COLOR_BUFFER_BIT);		/* clear the display */
	tempTexture.Bind();

	glBegin(GL_QUADS);
		// Front Face
		glTexCoord2f(0.0f, 0.0f); glVertex3f(50.0f,  50.0f,  0.0f);
		glTexCoord2f(1.0f, 0.0f); glVertex3f(100.0f,  50.0f,  0.0f);
		glTexCoord2f(1.0f, 1.0f); glVertex3f(100.0f,  100.0f,  0.0f);
		glTexCoord2f(0.0f, 1.0f); glVertex3f(50.0f,  100.0f,  0.0f);
	glEnd();

    glFlush();

    glutPostRedisplay();
    glutSwapBuffers();
}

//-----------------------------------------------------------------------------
void CApp::OnRender_Preview() {
    glutSetWindow(Win_Preview);

    glClear(GL_COLOR_BUFFER_BIT);		/* clear the display */
	tempTexture.Bind();

	glBegin(GL_QUADS);
		// Front Face
		glTexCoord2f(0.0f, 0.0f); glVertex3f(50.0f,  50.0f,  0.0f);
		glTexCoord2f(1.0f, 0.0f); glVertex3f(100.0f,  50.0f,  0.0f);
		glTexCoord2f(1.0f, 1.0f); glVertex3f(100.0f,  100.0f,  0.0f);
		glTexCoord2f(0.0f, 1.0f); glVertex3f(50.0f,  100.0f,  0.0f);
	glEnd();

    glFlush();

    glutPostRedisplay();
    glutSwapBuffers();
}

//=============================================================================

